package cn.bonoon.kernel.web.html;

import cn.bonoon.handler.impl.StandardAutoManager;
import cn.bonoon.kernel.descriptors.UIClassDescriptor;

public abstract class AbstractUIBuilder extends AbstractHtmlBuilder implements HtmlBuilder{
	protected final StandardAutoManager manager;
	protected final UIClassDescriptor uiDescriptor;
	
	protected AbstractUIBuilder(UIClassDescriptor uiDescriptor, StandardAutoManager manager, InternalHtmlInfo html) {
		super(html);
		this.uiDescriptor = uiDescriptor;
		this.manager = manager;
	}
	
	protected AbstractUIBuilder(UIClassDescriptor uiDescriptor, StandardAutoManager manager) {
		super(new InternalHtmlInfo(manager.getServletContext()));
		this.uiDescriptor = uiDescriptor;
		this.manager = manager;
	}

	public StandardAutoManager getManager() {
		return manager;
	}
	
	/**
	 * 绑定的数据结构的类的类名
	 */
	@Override
	public String getName() {
		return uiDescriptor.getName();
	}
}
